#pragma once

class CColorHelper
{
public:
	CColorHelper(void);
	~CColorHelper(void);
public:
	static UINT GABS (const int& nmbr)
	{
		return (nmbr>0)?nmbr:-nmbr;
	}

	static COLORREF DifferColor(COLORREF color, UINT nDist)
	{
		return RGB(
				GABS(GetRValue(color) - nDist),
				GABS(GetGValue(color) - nDist),
				GABS(GetBValue(color) - nDist)
			);
	}

	static COLORREF OrColor(COLORREF colFirst, COLORREF colSecond, UINT nPercent)
	{
		return RGB (
			( GetRValue(colFirst)*100 + ( nPercent*(GetRValue(colFirst)-GetRValue(colSecond)) ) ) /100,
			( GetGValue(colFirst)*100 + ( nPercent*(GetGValue(colFirst)-GetGValue(colSecond)) ) ) /100,
			( GetBValue(colFirst)*100 + ( nPercent*(GetBValue(colFirst)-GetBValue(colSecond)) ) ) /100 );
	}
};
